How to correctly handle the AttributeError: module 'matplotlib.pyplot' has no attribute 'clear' when

welcome to shbcf.ru